package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.CaCallNamesDto;
import com.dingreading.cloud.admin.dto.vo.MemberAccumulateVO;
import com.dingreading.cloud.admin.entity.CaCallNames;
import com.mybatisflex.core.service.IService;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface CaCallNamesService extends IService<CaCallNames> {

    List<CaCallNamesDto> getLessonCallNameDtos(String storeUid, String lessonUid);

    List<CaCallNames> getMemberCallListV3(String corpUid, String storeUid, String keyword, Integer callStatus,
                                          String beginDate, String endDate, String username, String projectUid, Integer status,
                                          List<Integer> callStatusList, List<Integer> hourTypeList);

    List<CaCallNamesDto> listByLessonUidIn(List<String> lessonUids);

    // 根据服务uid获取消耗的活动次数
    Map<String, Long> getCntByServiceUids(String storeUid, List<String> uids);


    // 获取自营门店的会员扣课时记录
    List<CaCallNames> getMemberCallList(String corpUid, String beginDate, String endDate, String productName);

    // 根据导读uid、导读姓名、会员uid、服务uid分组，获取会员的累计课次数量
    Map<List<String>, Map<String, MemberAccumulateVO>> getTotalMemberAccumulate(
            String corpUid, String storeUid, List<Integer> callStatusList, List<Integer> hourTypeList, Set<String> teacherUidList,
            String beginDate, String endDate
    );

    // 根据导读uid、导读姓名分组，获取会员的开始和结束日期的课次数量
    Map<List<String>, List<MemberAccumulateVO>> getMonthMemberAccumulate(
            String corpUid, String storeUid, List<Integer> callStatusList, List<Integer> hourTypeList, String beginDate,
            String endDate, List<String> storeUidList
    );

    // 上课状态已完成、课消状态正价和赠送、点名已到和迟到
    List<CaCallNames> consumeListBySelfStore(List<String> storeUidList, List<Integer> hourTypeList, String beginDate, String endDate);

    List<CaCallNames> getCallList(String corpUid, String beginDate, String endDate, List<String> projectUidList);

    // 更新会员点名记录的服务单价
    void updateUnitAmount(String uid, double unitAmount);
}
